package com.shoulder.log.filter;

import com.shoulder.log.utils.LogTraceUtils;
import jakarta.servlet.*;

import java.io.IOException;

public class LogTraceFilter implements Filter {
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        LogTraceUtils.set();
        filterChain.doFilter(servletRequest, servletResponse);
    }

    @Override
    public void destroy() {
        LogTraceUtils.clear();
    }
}
